//server.cpp
#include "header.hpp"
int main()
{
    // 1.获取key值
    key_t key = Getkey();
    // 2.创建共享内存
    int shmid = Createshm(key);
    // 3.和共享内存关联
    char *start = Attachshm(shmid);
    // 4.通信

    int count = 30;
    while (count--)
    {
        cout <<"client->server:" <<start << endl;
        sleep(1);
    }
    // 5.脱离关联
    Awayshm(start);
    // 6.删除共享内存
    Deleteshm(shmid);
    return 0;
}